package com.gxan.dao.impl;

import com.gxan.dao.UserDao;
import com.gxan.dbutils.JdbcBuild;
import com.gxan.pojo.User;

import java.sql.SQLException;

public class UserDaoImpl extends JdbcBuild implements UserDao {
    @Override
    public User findUserByUsernameAndPwd(String username, String password) throws SQLException {
        //用账户和密码查询数据库获取用户
        String sql = "select * from user where username = ? and password = ?";
        //调用工具类实现连接数据库并查询
        Object param[] ={username,password};
        return super.queryEntity(User.class,sql,param);
    }
}
